<?PHP

include_once("../include/common.inc.php");
global $page_time_start;
echo "页页开始执行时间:".$page_time_start;
$db= new DB_CLASS;//ݿģͲҳȥʵ,Ƿڰļ,ҪǿǵùʱNEW,ЩҳǲҪDB
$error=$db->connect(1,1);
if($error){
echo $error."<br>dbno:".$db->errorNo."<br>errorstr:".$db->errorString;
}else
{echo "连接,ID:<br>".$db->linkId;
}
echo "选择数据库:mysql<br>";
$error=$db->select_db("mysql");
if($error){
echo "错误:<br>".$error;
}else
{echo "选择数据库成功,<br>";}

echo "执行语句:select * from user<br>";
$sql="select * from user";
$db->query($sql);
echo "响应行数:".$db->numRows."<br>";

echo "详细数据如下:<br>";

while ($array=$db->db_fetch_array()){
echo implode(",",$array)."<br>";
}
echo "执行语句:select * from user<br>";
$sql="select * from user";
$db->query($sql);
echo "响应行数:".$db->numRows."<br>";

echo "详细数据如下:<br>";

while ($array=$db->db_fetch_array()){
echo implode(",",$array)."<br>";
}

echo "执行语句:select * from user<br>";
$sql="select * from user";
$db->query($sql);
echo "响应行数:".$db->numRows."<br>";

echo "详细数据如下:<br>";

while ($array=$db->db_fetch_array()){
echo implode(",",$array)."<br>";
}





echo "关闭前总共行数:".$db->numRows."<br>";

echo "开始关闭连接<br>";
$db->db_close();
echo "数据库查询数:".$db->queryNum."<br>";
$db=NULL;
echo "连接关闭后DB影响行数:".$db->numRows.'<br>';
echo "页面执行结束时间:".microtime().'<br>';
list($usec,$sec)=explode(' ',microtime());
$page_time_end=bcadd($usec,$sec,4);
echo "页面执行时间:".bcsub($page_time_end,$page_time_start,4)."秒";
?>